﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLySieuThi.BUS
{
    public class CKiemTra
    {
        public DTO.CKhachHang SelectIndexChangeKhachHang(DataGridView dgv)
        {
            int index = dgv.CurrentRow.Index;
            DataGridViewRow row = dgv.Rows[index];
            DTO.CKhachHang kh = new DTO.CKhachHang();

            kh.TenKH = row.Cells[0].Value.ToString();
            kh.CMND = row.Cells[1].Value.ToString();
            kh.SoDienThoai = row.Cells[2].Value.ToString();
            kh.DiaChi = row.Cells[3].Value.ToString();
            kh.NgaySinh = row.Cells[4].Value.ToString();
            return kh;
        }
        public DTO.CNhanVien SelectIndexChangeNhanVien(DataGridView dgv)
        {
            int index = dgv.CurrentRow.Index;
            DataGridViewRow row = dgv.Rows[index];
            DTO.CNhanVien nv = new DTO.CNhanVien();

            
            nv.TenNV = row.Cells[1].Value.ToString();
            nv.DiaChi = row.Cells[2].Value.ToString();
            nv.BangCap = row.Cells[3].Value.ToString();
            nv.ChucVu = row.Cells[4].Value.ToString();
            nv.SoDienThoai = row.Cells[5].Value.ToString();
            return nv;
        }
    }
}
